/**
 * 
 */
package truerefactor.refactor;

import java.util.List;

import truerefactor.graph.ClassNode;
import truerefactor.graph.CodeGraph;
import truerefactor.graph.CodeNode;

/**
 * An implementation of the Replace Inheritance with Delegation Refactoring
 * Technique
 * 
 * @author Isaac
 */
public class InheritanceToDelegation extends Refactoring {

    /**
     * 
     */
    public InheritanceToDelegation()
    {
        this.name = "Change Inheritance to Delegation";
        this.description = "";
    }

    /*
     * (non-Javadoc)
     * @see
     * truerefactor.refactor.Refactoring#execute(truerefactor.graph.CodeNode
     * [])
     */
    @Override
    public void execute(CodeGraph graph)
    {
        // 1. Create a field in the subclass that refers to an instance of the
        // superclass. Initialize it to this.

        // 2. Change each method defined in the subclass to use the delegate
        // field.
        // a. You won't be able to replace any methods that invoke a method on
        // super that is defined on the subclass, or they may get into an
        // infinite recurse. These methods can be replace only after you have
        // broken the inheritance.

        // 3. remove the subclass declaration and replace the delegate
        // assignment with an assignment to a new object.

        // 4. For each superclass method used by a client, add a simple
        // delegating method.
    }
}
